const { addAccountInfo } = require('../model/account');
const message = require('../model/returnMessage');

exports.register = async (req, res, next) => {
  addAccountInfo(req.body).then(
    (r) => {
      res
        .status(201)
        .json(message({ username: req.body.username }, 'Created.'));
    },
    (e) => {
      res.status(500).json(message({}, 'Internal server error.'));
    }
  );
};
